#shapefile of congressional districts
#source: http://cdmaps.polisci.ucla.edu/
shape <- read_sf("~/Desktop/website_dev/google_ads/data/districtShapes/districts114.shp")
#state postal codes
states <- cbind(state_abr=state.abb, STATENAME=state.name) %>% as.data.frame()
#Subset, merge on state abbreviation, and create congressional district variable for ad data linkage
shape <- shape %>%
filter(STATENAME != "Alaska") %>%
filter(STATENAME != "Hawaii") %>%
left_join(states, by=c("STATENAME")) %>%
mutate(cong_dis = paste0(state_abr, "-", DISTRICT)) %>%
dplyr::select(cong_dis, state_abr)
#read in ad data
dt <- fread("~/Desktop/website_dev/google_ads/data/google-political-ads-transparency-bundle/google-political-ads-geo-spend.csv")
#sum spending over state
dt <- dt %>%
filter(Country=="US" & !is.na(Country_Subdivision_Secondary)) %>%
group_by(Country_Subdivision_Secondary) %>%
summarise(spending=sum(Spend_USD)) %>%
mutate(state_var = substr(Country_Subdivision_Secondary, 4, 11),
state = substr(Country_Subdivision_Secondary, 1, 2)) %>%
filter(state_var != "AT LARGE") %>%
dplyr::select(spending, cong_dis=Country_Subdivision_Secondary, state)
#merge together
shape.data <- inner_join(shape, dt, by="cong_dis") %>%
dplyr::select(spending, state, cong_dis)I mapped the congressional districts for the top 5 states in terms of ad dollars spent since June 2018, with each state totaling more the 5 million dollars. Those states were, in descending order of ad dollars spent, Florida (total of 10.7 million), California (9.1 M), Texas (5.6 M), Tennessee (5.1 M), and Arizona (5.0 M). And of course I had to include my dear home state of Georgia (1.9 M). These maps provide insight into the geographic distribution of ad spending within these political-ad bombarded states.
#subset and plot
shape.data %>%
filter(state=="FL") %>%
ggplot() +
geom_sf(aes(fill=spending), color="gray30") +
scale_fill_viridis_c(labels=comma, name="USD") +
ggtitle(paste0("Florida - June 2018 to December 2019"))Districts with the greatest spending-in excess of $800,000-include Florida’s 10th and 27th districts. For context, spending in these districts is greater than total spending in 21 states. Florida’s 10th district includes the city of Orlando and surrounding westward counties, while Florida’s 27th district contains a large part of the city of Miami and southern Miami-Dade county.
#subset and plot
shape.data %>%
filter(state=="CA") %>%
ggplot() +
geom_sf(aes(fill=spending), color="gray30") +
scale_fill_viridis_c(labels=comma, name="USD") +
ggtitle(paste0("California - June 2018 to December 2019"))Districts receiving the most dollars in political ads in California include the 10th, 25th, 39th, 45th, and 48th. All of these districts border or are within the largely blue Los Angeles Metropolitan Area with the exception of the 10th district, which includes more moderate areas of Modesto and San Joaquin County.
#subset and plot
shape.data %>%
filter(state=="TX") %>%
ggplot() +
geom_sf(aes(fill=spending), color="gray30") +
scale_fill_viridis_c(labels=comma, name="USD") +
ggtitle(paste0("Texas - June 2018 to December 2019"))Political ad spending in Texas congregates around its two most populous metropolitan areas: Houston-The Woodlands and Dallas-Fort Worth. While the northern panhandle of Texas receives relatively few ad dollars, the districts south of Dallas-Forth Worth and west of Houston have received $200,000-400,000 in the past 14 months.
#subset
shape.data %>%
filter(state=="TN") %>%
ggplot() +
geom_sf(aes(fill=spending), color="gray30") +
scale_fill_viridis_c(labels=comma, name="USD") +
ggtitle(paste0("Tennessee - June 2018 to December 2019"))The geographical epicenter of political ad dollars in Tennessee is pretty clear: the largely liberal 5th congressional district, which includes the city of Nashville. Notably, this district has received $1.1 M, almost double the total ad dollars that the 9th district, the second-highest, received.
#subset and plot
shape.data %>%
filter(state=="AZ") %>%
ggplot() +
geom_sf(aes(fill=spending), color="gray30") +
scale_fill_viridis_c(labels=comma, name="USD") +
ggtitle(paste0("Arizona - June 2018 to December 2019"))In a landlocked state with very little population near its borders, Arizona’s 7th district lights up the map with over a million ad dollars spent. This district is Democrat-controlled and includes much of inner Phoenix and the eastern portion of Glendale.
#subset
shape.data %>%
filter(state=="GA") %>%
ggplot() +
geom_sf(aes(fill=spending), color="gray30") +
scale_fill_viridis_c(labels=comma, name="USD") +
ggtitle(paste0("Georgia - June 2018 to December 2019"))The map of political ad spending across Georgia’s congressional districts appears to support the trend observed above-that urban and suburban areas receive the lion-share of ad dollars. Georgia’s 6th district has received the most funding for ads across the state. This finding makes sense given that the district flipped from a long-held Republican control to moderate Democrat control in the 2018 midterm and will likely be viewed as a site for critical swing voters in the 2020 election.
This post highlights the primary geographical targets of political ad spending. My subsequent posts (and Rshiny) will investigate time trends and identify the primary actors and funders behind the spending.
A work by Will Godwin